package edu.sctu.zhuyingzhi.month201505.day20150517.homework;


import java.util.*;

/**
 * Created by user13 on 2015/5/17.
 */
public class TextOne extends TextMore{

    public void getTercherInfo(){

//        TexMain numberRank= new TexMain();

        Teacher[] teacherArray = sotrNumber();


        for (int i = 0; i < teacherArray.length; i++) {
            System.out.println(teacherArray[i].getNumber()+teacherArray[i].getName()+teacherArray[i].getSex()+teacherArray[i].getLesson());

            for (int j = 0; j < teacherArray[i].getStudent().length; j++)
            {
                System.out.println("学生是（"+teacherArray[i].getStudent()[j].getName()+")");
            }
        }


    }


    public List<Teacher> getStudent(int code){
        List<Teacher> list = new ArrayList<>();
        TextOne numberRank= new TextOne();


        for (int i = 0; i < numberRank.pritCoded().size(); i++) {
            for (int j = 0; j <numberRank.pritCoded().get(i).getStudent().length ; j++) {


            if (  numberRank.pritCoded().get(i).getStudent()[j].getGradle()>code){

                list.add(numberRank.pritCoded().get(i));
            }
        }
        }
        return list;
    }

    public void getCode(){
        List<Teacher> list = new ArrayList<>();

        TextOne numberRank1= new TextOne();
        list = numberRank1.pritCoded();
        for (int i = 0; i < list.size(); i++) {

            for (int j = 0; j < list.get(i).getStudent().length; j++) {


                System.out.print(list.get(i).getStudent()[j].getName() + "\t");
            }

        }

        InterMethod inter = new InterMethod() {
            @Override
            public void method(Student student) {
                TextOne numberRank1= new TextOne();
                List<Teacher> list1 =numberRank1.getStudent(72);
                System.out.println(list1.size());

                System.out.println(list1.get(4).getName());

                    for (int j = 0; j < list1.size(); j++) {


                        System.out.println(list1.get(j).getStudent()[j].getName());


                    }
                }

        };


                inter.method(list.get(0).getStudent()[0]);

        }



}
